home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / AppleScanGS / Scan.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-28  |  1.8 KB  |  69 lines  |  [TEXT/MPS ]

  1. /***********************************************************************
  2. *
  3. * Scan.c (Main Program)
  4. *
  5. * Copyright (c)
  6. * Apple Computer, Inc.  1986-1989
  7. * All Rights Reserved.
  8. *
  9. * This file contains the scanner program.
  10. *
  11. ***********************************************************************/
  12.  
  13. #include <types.h>
  14. #include <quickdraw.h>
  15. #include <qdaux.h>
  16. #include <window.h>
  17. #include <locator.h>
  18. #include <texttool.h>
  19. #include <intmath.h>
  20. /* Include this line to use Tool039 (the Scanner Toolset)
  21. #include "scToolSet.h"
  22. */
  23.  
  24. main()
  25. {
  26.     Ref     initRef;        /* This holds the reference to the startstop record */
  27.     char    errBuf[5];
  28.  
  29.     initGlobals();          /* Initialize our globals. */
  30.     
  31.     TLStartUp();            /* start up the tool locator */
  32.     
  33.     /* Startup the tools using the new toolbox call */
  34.     initRef = StartUpTools(_ownerid, refIsResource, 0x0001L);
  35.     if (!_toolErr) {
  36. #ifdef __scToolSet__
  37.         LoadOneTool(39, 1);    /* load the Scanner toolset */
  38.         if(_toolErr) {
  39.             InitCursor();
  40.             ErrorWindow(0,NULL,_toolErr);
  41.             WaitCursor();
  42.         } else if(findScanner()) {    /* find the device number of the scanner */
  43. #else
  44.         if(findScanner()) {    /* find the device number of the scanner */
  45. #endif
  46.             setupMenus();       /* Set up menus */
  47.             setupWindows();
  48.             InitCursor();       /* Make cursor show ready */
  49.             mainEvent();        /* Use application */
  50. #ifdef __scToolSet__
  51.             scShutDown();        /* shut down the scanner toolset */
  52.             UnloadOneTool(39);
  53. #endif
  54.         }
  55.         ShutDownTools(refIsHandle, initRef);
  56.             /* Let the toolbox shutdown the tools. */
  57.     } else {
  58.         Int2Hex(_toolErr, &errBuf[1], 4);
  59.         errBuf[0] = 4;
  60.         WriteLine("\pUnable to start toolsets.");
  61.         WriteCString("Error code = $");
  62.         WriteLine(errBuf);
  63.         WriteLine("\pPress any key to quit...");
  64.         ReadChar(0);
  65.     }
  66.  
  67.     TLShutDown();
  68. /*    qFlags = 0x4000;    /* we can be restarted from memory */
  69. }